package com.singfan.core.dao.database.impl;

import com.singfan.common.db.DaoBaseGeneric;
import com.singfan.core.dao.database.IManagerDao;
import com.singfan.core.dao.database.model.Manager;
import org.springframework.stereotype.Repository;

/**
 * Author: hansonghe
 * Date: 2015-10-13 17:41
 * Desc:
 */
@Repository
public class ManagerDaoImpl extends DaoBaseGeneric<Manager> implements IManagerDao {
    @Override
    protected String getTableName(Object hashKey) {
        return tableNameBase;
    }

    @Override
    protected String getDatabaseId(Object hashKey) {
        return "app_1";
    }

    @Override
    public Manager selectByEmailAndPwd(String email, String pwd) {
        String sql = "SELECT * FROM " + getTableName("") + " WHERE email=? AND password=?";
        return selectOne(null, sql, email, pwd);
    }
}
